import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljHighlightForm, XhljHighlightQuery, XhljHighlightVo } from '@/api/xhlj/model/highlightModel';
import { request } from '@/utils/request';

// 查询大会亮点列表
export function listHighlight(query?: XhljHighlightQuery) {
  return request.get<TableDataInfo<XhljHighlightVo>>({
    url: '/xhlj/highlight/list',
    params: query,
  });
}

// 查询大会亮点详细
export function getHighlight(highlightId: number) {
  return request.get<R<XhljHighlightVo>>({
    url: `/xhlj/highlight/${highlightId}`,
  });
}

// 新增大会亮点
export function addHighlight(data: XhljHighlightForm) {
  return request.post<R<void>>({
    url: '/xhlj/highlight',
    data,
  });
}

// 修改大会亮点
export function updateHighlight(data: XhljHighlightForm) {
  return request.put<R<void>>({
    url: '/xhlj/highlight',
    data,
  });
}

// 删除大会亮点
export function delHighlight(highlightIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/highlight/${highlightIds}`,
  });
}
